<?php 
include_once("round_schedule_repository.php");
$repSchedule= new RoundScheduleRepository;
$roundID=$_POST['roundID'];
$schedles=$repSchedule->maps($repSchedule->getScheduleByRoundID($roundID));
$repSchedule->deleteTables($roundID);
foreach ($schedles as $s){
	
	$t="table".$s->round_scheduleID;
	$table=$_POST[$t];
	$repSchedule->addTable($s->round_scheduleID,$table);
}

		header('LOCATION:'.$_SERVER["HTTP_REFERER"]);
?>
